package com.dnui.seven2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dnui.seven2.entity.Article;
import com.dnui.seven2.entity.Merch;
import com.dnui.seven2.service.ArticleService;
import com.dnui.seven2.mapper.ArticleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fengy
 * @description 针对表【article】的数据库操作Service实现
 * @createDate 2022-10-16 09:00:23
 */
@Service
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article>
        implements ArticleService{

    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public List<Article> selectAll() {
        //构造条件构造器
        LambdaQueryWrapper<Article> queryWrapper=new LambdaQueryWrapper();
        List<Article> articles = articleMapper.selectList(null);
        return articles;
    }

    @Override
    public List<Article> queryArticles(int page, int pageSize) {
        return null;
    }



    @Override
    public void deleteArticle(Long articleId) {
        articleMapper.deleteById(articleId);
    }

    @Override
    public Article queryById(Long articleId) {
        return null;
    }

    @Override
    public void updateArticle(Article article) {
        articleMapper.updateById(article);
    }
}




